package moxl.xpath.axes;

import java.util.Iterator;

import moxl.dom.MoxlNode;
import moxl.xpath.parser.types.NodeTestMatcher;

public class XmlNodeListIterable implements Iterable<MoxlNode>
{
	private final Iterator<MoxlNode> nodesToChooseFrom;
	private final NodeTestMatcher nodeTestMatcher;

	public XmlNodeListIterable(Iterator<MoxlNode> nodesToChooseFrom, NodeTestMatcher nodeTestMatcher)
	{
		this.nodesToChooseFrom = nodesToChooseFrom;
		this.nodeTestMatcher = nodeTestMatcher;
	}

	public Iterator<MoxlNode> iterator()
	{
		return new XmlNodeListIterator(nodesToChooseFrom, nodeTestMatcher);
	}
}
